from buildings import level

class tower (object) :
    def __init__ (self, num_levels) :
        self.levels = {}
        self.people = []
        self.pop = 0
        self.num_levels = num_levels
        self.map = None
    def get_pop (self) :
        return self.pop
    def get_levels (self) :
        return self.num_levels
    def __del__ (self) :
        for levels in self.levels :
            del levels
        for person in self.people :
            del person
    def update (self, dt) :
        for level in self.levels :
            self.levels[level].update (dt)
        for person in self.people :
            person.update (dt)
    def draw (self) :
        for level in self.levels :
            self.levels[level].draw ()
        for person in self.people :
            person.draw ()       
    def add_building (self, l, building) :
        if not l in self.levels :
            self.levels[l] = level (self, l)
        self.levels[l].add_building (building)
